home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Code folding / unfoldAllChildren.script < prev   
Encoding:
Text File  |  2001-06-19  |  672 b   |  31 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: unfoldAllChildren~opens all children of the currently selected 
  6. parent line. 
  7. @EndTool: 
  8. @Summary: unfoldAllChildren~opens all child lines 
  9. */
  10.  
  11.  
  12. function DoCommand()
  13. {
  14.   var editor = getActiveEditor();
  15.   if (editor)
  16.   {
  17.     var lines = editor.getLines();
  18.     var selection = editor.GetSelection();
  19.     var childIndex = lines.getFirstChildLineIndex(selection.startLineIndex); 
  20.     while (childIndex != -1)
  21.     {
  22.       lines.unfoldLine(childIndex);
  23.       childIndex = lines.getNextSiblingLineIndex(childIndex);
  24.     }
  25.     lines.update("Unfold All Children");
  26.   }
  27. }
  28.  
  29. !!/Script
  30.  
  31.